import maya.cmds as mc
import maya.mel as mel
class LZ_UI():
    def __init__(self):
        pass
    def loadTextField(self,tfName = '' ):
    
        objsel = mc.ls(sl=True)
        
        fillCon = ''
        num=0
        for obj in objsel:
            if num == 0:
                fillCon = obj
            else:
                fillCon = fillCon + ' ' + obj 
            num = num+1
        mc.textField( tfName ,e=True,text= fillCon )
        
        
    def seperateList(self,inputValue = ['','']):
        output_all =[]
        for iv in inputValue:
            if ':' in iv:
                output_values =[]
                splitValue = str(iv).split(':')
                if len(splitValue)==2:
                    
                    stateText = splitValue[0].split('[')[0]
                    valueBefore = int(splitValue[0].split('[')[-1])
                    valueBehand = int(splitValue[1].split(']')[0])
                    
                    
                    diffence = valueBehand-valueBefore
                    
                    for num in range(diffence+1):
                        output_value = stateText+'['+ str(valueBefore + num) + ']'
                        output_values.append(output_value)
                        
            else:
                output_values= [iv]
                
            output_all = output_all+output_values
                
        return output_all
        
    def getTextFieldInfo(self,Field = ''):
        objInfo = []
        text = mc.textField(Field,q=True,text=True)
        textSplit = text.split(' ')
        for t in textSplit:
            if ' ' in t:
                pass
            elif t == '':
                pass
            else:
                objInfo.append(t)
        return objInfo
        